package com.biz.primus.management.coupon.type.feign;

import com.biz.primus.common.vo.SpringPageVO;
import com.biz.primus.management.coupon.type.degraded.DegradedCouponTypeFeignClient;
import com.biz.primus.model.coupon.vo.couponType.CouponTypeDetailVo;
import com.biz.primus.model.coupon.vo.couponType.CouponTypeVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 优惠券类型Feign Client
 *
 * @author david-liu
 */
@FeignClient(name = "service-coupon", fallback = DegradedCouponTypeFeignClient.class)
public interface CouponTypeFeignClient {

    @PostMapping(value = "/soa/couponType/createCouponType")
    Boolean createCouponType(@RequestBody CouponTypeVo couponTypeVo);

    @GetMapping(value = "/soa/couponType/listCouponTypes")
    SpringPageVO<CouponTypeDetailVo> listCouponTypes(
            @RequestParam(name = "name") String name,
            @RequestParam(name = "page", defaultValue = "0") int page,
            @RequestParam(name = "pageSize", defaultValue = "50") int pageSize);
}
